import tkinter #as tk

window = tkinter.Tk()
window.title = ('窗口名字')
window.geometry("200x100")  # 设置窗口尺寸

var = tkinter.StringVar()
l = tkinter.Label(window, textvariable=var, bg='green', font=('Arial', 12), width=15, height=2)  # window 上做一个lable
l.pack()
# l.place
on_hit = False


def hit_me():
    global on_hit
    if on_hit == False:
        on_hit = True
        var.set('you hit me ')
    else:
        on_hit = False
        var.set('')


b = tkinter.Button(window, text='按钮1', width=15, height=2, command=hit_me, bg='green')
b.pack()
window.mainloop()  # 使运行的最重要的一步
